Component({
    behaviors: [],
    storeBindings: [],
    data: {
        storeInfo: ''
    },

    methods: {
        onLoad(options) {
            this.setData({ storeInfo: options })
        },
        onReachBottom() {
            let child = this.selectComponent(".child")
            child.onReachBottom && child.onReachBottom();
        },

        // 懒加载传值 listIndex
        onShow() {
            //获取屏幕尺寸
            const screenWidth = wx.getSystemInfoSync().windowWidth
            const screenHeight = wx.getSystemInfoSync().windowHeight
            this.setData({
                //获取页面初始状态图片数量，0.63为图片容器的高度值(63vw)，将代码中0.63改为你的容器对应高度
                listIndex: screenHeight / (screenWidth * 0.33),
                screenWidth: screenWidth,
                screenHeight: screenHeight
            })
        },
        // 滚动事件 
        onPageScroll(e) {
            //滚动距离+屏幕高度换算vw倍数
            let listIndex = (e.scrollTop + this.data.screenHeight) / (this.data.screenWidth * 0.33)
            this.setData({
                listIndex: listIndex
            })
        },
        // 下拉刷新
        onPullDownRefresh(e) {
            let child = this.selectComponent(".child")
            child.onPullDownRefresh && child.onPullDownRefresh();
        }
    }
})
